package Basic;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

public class EventsActionListener implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent e) {/*监听事件触发，该方法被调用，监听事件源为参数被传入*/
		JButton jButton=(JButton)e.getSource();/*获取原本的监听事件源对象，强制类型转换*/
		jButton.setText("被点击了");/*设置事件源的名称为:被点击了*/
	}

}
